<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <link rel="stylesheet" th:href="@{/static/element/index.css}"/>
</head>
<body>
<div id="app">
    <template>
        <el-form :model="formData" ref="formData" :rules="rules" label-width="100px" style="margin-top: 5%">
                                                                    <el-form-item label="名称" prop="name">
                    <el-input v-model="formData.name" placeholder="请输入名称" />
                </el-form-item>
                                                                                        <el-form-item label="人数" prop="number">
                    <el-input v-model="formData.number" placeholder="请输入人数" />
                </el-form-item>
                                                                                        <el-form-item label="详情" prop="details">
                    <el-input v-model="formData.details" placeholder="请输入详情" />
                </el-form-item>
                                                                                        <el-form-item label="创建人账号" prop="createById">
                    <el-input v-model="formData.createById" placeholder="请输入创建人账号" />
                </el-form-item>
                                                                                                        <el-form-item label="创建人名称" prop="createByName">
                    <el-input v-model="formData.createByName" placeholder="请输入创建人名称" />
                </el-form-item>
                                                                                        <el-form-item label="更新人账号" prop="updateById">
                    <el-input v-model="formData.updateById" placeholder="请输入更新人账号" />
                </el-form-item>
                                                                                                        <el-form-item label="更新人名称" prop="updateByName">
                    <el-input v-model="formData.updateByName" placeholder="请输入更新人名称" />
                </el-form-item>
                                                                                        <el-form-item label="逻辑删除" prop="deleted">
                    <el-input v-model="formData.deleted" placeholder="请输入逻辑删除" />
                </el-form-item>
                                </el-form>
        <div style="text-align: center;margin-top: 5%">
            <el-button size="small" @click="closePage">取 消</el-button>
            <el-button size="small" type="primary" @click="handleSubmit">确 定</el-button>
        </div>
    </template>
</div>
</body>
<script th:src="@{/static/js/axios.min.js}"></script>
<script th:src="@{/static/js/request.js}"></script>
<script th:src="@{/static/js/common.js}"></script>
<script th:src="@{/static/api/tTeam.js}"></script>
<script th:src="@{/static/js/vue.min.js}"></script>
<script th:src="@{/static/element/index.js}"></script>
<script th:src="@{/static/js/jquery.min.js}"></script>
<script th:src="@{/static/layer/layer.js}"></script>
<script>
    let id = getQueryString("id");
    new Vue({
        el: '#app',
        data() {
            return {
                formData: {
                    id: '',
                    postName: '',
                    postCode: '',
                    remark: ''
                },
                rules: {
                                                                                                                                                                                                                                                                                                                                                                createTime: [
                                { required: true, message: "创建时间不能为空", trigger: "blur" }
                            ],
                                                                                                                                                                                                                                                    updateTime: [
                                { required: true, message: "修改时间不能为空", trigger: "blur" }
                            ],
                                                                                                                                                    }
            }
        },
        created() {
            if (id) {
                detail(id).then((res) => {
                    if (res.code === '200') {
                        this.formData = res.data
                    }
                });
            } else {
                this.formData = {}
            }

        },
        methods: {
            handleSubmit() {
                if (id) {
                    addOrUpdate('/admin/tTeam/update', this);
                } else {
                    addOrUpdate('/admin/tTeam/add', this);
                }
            }
        }
    });
</script>
</html>
